package com.blockchainenergy.info.node.impl;

import com.blockchainenergy.info.node.NodeService;
import com.blockchainenergy.info.node.Node;
import com.blockchainenergy.info.node.dao.NodeDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @descriptions:
 * @data: 2021/10/23 12:40
 */
@Service
@Transactional
public class NodeServiceImpl implements NodeService {
    @Resource
    private NodeDao nodeDao;

    private final static Integer NUMS_OF_NODES = 33;

    @Override
    public List<Node> getNodes() throws Exception {
        List<Node> nodes = new ArrayList<>();
        for (int i = 0; i < NUMS_OF_NODES; i++) {
            nodes.add(new Node(i));
        }
        return nodes;
    }
}
